package com.phamkhanh.controller;


import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;



@Controller
@RequestMapping("/index.html")
public class IndexController {
	
	private static final Logger logger = Logger.getLogger(IndexController.class);
	
	@RequestMapping(method=RequestMethod.GET)
	public String indexAction(HttpServletRequest request){
		logger.info("Bắt đầu vào trang index.html");
		if(request.getSession().getAttribute("user") == null){
			return "redirect: login.html";
		}else return "index.jsp";
	}
}
